﻿using UnityEngine;
using System.Collections;

public class SelectedCharacterModel : MonoBehaviour {

    public SteveBrain steveBrain;
    public FrenzyPeopleController peopleCtrl;
    
    #region Skill

    public int Skill_S {
        get {
            if (steveBrain == null || steveBrain.model == null) return 0;
            return steveBrain.model.Skills.GetValue(Engine.Entities.Character.SkillsEnum.Strenght);
        }
    }
    public int Skill_A
    {
        get
        {
            if (steveBrain == null || steveBrain.model == null) return 0;
            return steveBrain.model.Skills.GetValue(Engine.Entities.Character.SkillsEnum.Strenght);
        }
    }
    public int Skill_C
    {
        get
        {
            if (steveBrain == null || steveBrain.model == null) return 0;
            return steveBrain.model.Skills.GetValue(Engine.Entities.Character.SkillsEnum.Strenght);
        }
    }
    public int Skill_R
    {
        get
        {
            if (steveBrain == null || steveBrain.model == null) return 0;
            return steveBrain.model.Skills.GetValue(Engine.Entities.Character.SkillsEnum.Strenght);
        }
    }
    public int Skill_I
    {
        get
        {
            if (steveBrain == null || steveBrain.model == null) return 0;
            return steveBrain.model.Skills.GetValue(Engine.Entities.Character.SkillsEnum.Strenght);
        }
    }

    #endregion Skill
    
    public string NameSurname {
        get {
            if (steveBrain != null && steveBrain.model != null)
                return steveBrain.model.Name + " " + steveBrain.model.Surname;
            else
                return "-";
        }
    }

    public int Level {
        get
        {
            if (steveBrain != null && steveBrain.model != null)
                return steveBrain.model.LV;
            else
                return 0;
        }
    }

    public int Happy
    {
        get
        {
            if (steveBrain != null && steveBrain.model != null)
                return steveBrain.model.Happiness;
            else
                return 0;
        }
    }

    public string ExpStr
    {
        get
        {
            if (steveBrain != null && steveBrain.model != null && peopleCtrl != null)
                return steveBrain.model.Exp + "/" + peopleCtrl.GetMaxExp(Level);
            else
                return "-/-";
        }
    }

    public float ExpFract
    {
        get
        {
            if (steveBrain != null && steveBrain.model != null && peopleCtrl != null)
                return steveBrain.model.Exp / peopleCtrl.GetMaxExp(Level);
            else
                return 0;
        }
    }

    public string HPStr
    {
        get
        {
            if (steveBrain != null && steveBrain.model != null && peopleCtrl != null)
                return steveBrain.model.HP + "/" + peopleCtrl.GetMaxHP(Level);
            else
                return "-/-";
        }
    }

    public float HPFract
    {
        get
        {
            if (steveBrain != null && steveBrain.model != null && peopleCtrl != null)
                return steveBrain.model.HP / peopleCtrl.GetMaxHP(Level);
            else
                return 0;
        }
    }

    public string AVGStr {
        get
        {
            if (steveBrain != null && steveBrain.model != null && peopleCtrl != null)
                return peopleCtrl.GetAVGSkills(steveBrain.model.Skills).ToString() + " %";
            else
                return "ND.";
        }
    }

    public float AVGFract
    {
        get
        {
            if (steveBrain != null && steveBrain.model != null && peopleCtrl != null)
                return peopleCtrl.GetAVGSkills(steveBrain.model.Skills);
            else
                return 0;
        }
    }


}
